FROM crpi-6fc1j1jzo1cwbtgf.cn-chengdu.personal.cr.aliyuncs.com/sirping/php74-fpm-alpine:1.0

ARG INSTALL_SUPERVISOR=false
# 可选安装Supervisor
RUN if [ "$INSTALL_SUPERVISOR" = "true" ]; then \
    apk add --no-cache supervisor; \
    fi

# 设置工作目录
WORKDIR /var/www

# 设置Composer缓存目录
ENV COMPOSER_HOME=/tmp/composer

# 启动命令
CMD ["sh","-c","if [ -x /usr/bin/supervisord ]; then /usr/bin/supervisord -n -c /etc/supervisord.conf; else php-fpm; fi"]